import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import AbbeyRoad from '@/components/AbbeyRoad'
import TodoList from '@/components/TodoList'
import Blog from '@/components/Blog'
import BlogList from '@/components/BlogList'
import BlogContent from '@/components/BlogContent'
import KnowledgePoint from '@/components/KnowledgePoint'
import taB from '@/components/tab'
import page404 from '@/components/page404'
import demo from '@/components/elementDemo'

Vue.use(Router)

export default new Router({
  // mode: 'history',
  routes: [
    {
      path: '/hello',
      name: 'HelloWorld',
      component: HelloWorld,
      children: [
        {
          path: '',
          component: page404
        }
      ]
    },
    {
      path: '/abbey',
      name: 'AbbeyRoad',
      component: AbbeyRoad
    },
    {
      path: '/todo',
      name: 'todolist',
      component: TodoList
    },
    {
      path: '/blog',
      name: 'blog',
      component: Blog
    },
    {
      path: '/bloglist',
      name: 'bloglist',
      component: BlogList,
      children: [
        {
          path: ':id',
          component: BlogContent
        }
      ]
    },
    {
      path: '/knowledgepoint',
      name: 'knowledgepoint',
      component: KnowledgePoint
    },
    {
      path: '/tab',
      name: 'tab',
      component: taB
    },
    {
      path: '/demo',
      name: 'demo',
      component: demo
    }
  ]
})
